package com.gdut.huayan.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gdut.huayan.validation.NumRange;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_charity_page")
public class CharityPage implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(groups = {GroupUpdate.class},message = "id不能为空")
    @Null(groups = {GroupAdd.class},message = "id不允许填写")
    private Long id;

    @NotNull(groups = {GroupAdd.class},message = "activityId不能为空")
    private Long activityId;

    private Long coverImageId;

    /**
     * 是否是置顶的活动 1-是 2-不是
     */
    @NumRange(min = 1,max=2,message = "type类型错误")
    private Integer type;

    /**
     * 是否显示 1-是 2-不是
     */
    @NumRange(min = 1,max = 2,message = "isShow参数错误")
    private Integer isShow;
}
